<template>
  <div>
    <h1>父组件的{{num}}</h1>
    <button @click="num++">+</button>
    <button @click="show=!show">switch</button>
    <hr>
    <child v-if="show"></child>
  </div>
</template>

<script>
import Child from '@/Child.vue'
export default {
  components:{Child},
  data(){
    return{
      num:0,
      show:true
    }
  },
  beforeCreate() {
    console.log("========父组件beforeCreate===========");
  },
  created() {
    console.log("========父组件created===========");
  },
  beforeMount() {
    console.log("========父组件beforeMount===========");
  },
  mounted() {
    console.log("========父组件mounted===========");
  },
  beforeUpdate() {
    console.log("========父组件beforeUpdate===========");
  },
  updated() {
    console.log("========父组件updated===========");
  },
  beforeDestroy() {
    console.log("========父组件beforeDestroy===========");
  },
  destroyed() {
    console.log("========父组件destroyed===========");
  },
};
</script>

<style></style>
